﻿using System;
using System.Collections.Generic;
using System.Text;
using TTClassLibrary;
using TTServer.Messages;
using System.Windows.Forms;
using System.Drawing;
using TTServer.Objects;

namespace TTServer.MessageProcessors
{
    class FileDetailsRequestMessageProcessor: IMessageProcessor
    {
        public bool Process(libCommonClass.TTMessage message, libInterface.IClientInfoProvider clientInfoProvider)
        {
            if (message is FileDetailsRequestMessage)
            {
                //CFileDetail fd = new CFileDetail();
                //fd.Name = "123";
                //fd.Lenght = 12323;
                //fd.DirectoryFullPath = "adad";
                //fd.CreationTime = "123123";
                //fd.LastAccessTime = "2312313";
                //fd.LastWriteTime = "423423423";

               CFileDetail fd = FileExplorer.GetFileDetail(((FileDetailsRequestMessage)message).FilePath);
                
                FileDetailsResponseMessage res = new FileDetailsResponseMessage(fd);
                clientInfoProvider.AddToMessageQueue(res);

                return true;
            }

            return false;
        }
    }
}
